package cn.wolfcode.p2p.business.controller;

import cn.wolfcode.p2p.business.domain.BidRequest;
import cn.wolfcode.p2p.business.service.IBidRequestAuditHistoryService;
import cn.wolfcode.p2p.business.service.IBidRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 后台体验标详情
 */
@Controller
public class BorrowController {
    @Autowired
    private IBidRequestService bidRequestService;

    @Autowired
    private IBidRequestAuditHistoryService bidRequestAuditHistoryService;



    /**
     * 借款详情
     */
    @RequestMapping("borrow_info")
    public String borrowInfo(Long id, Model model) {
        //借款
        BidRequest bidRequest = bidRequestService.getBidRequestById(id);
        model.addAttribute("bidRequest", bidRequest);
        model.addAttribute("audits",bidRequestAuditHistoryService.listByBidRequestId(id));
        return "expbidrequest/borrow_info";
    }


}
